const { defineConfig } = require('@vue/cli-service');
const webpack = require('webpack');

module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false,

  devServer: {
    port: 8081,
    host: "0.0.0.0",
    open: true,
    proxy: {
      '/api': {
        target: process.env.VUE_APP_BASE_API, // 使用环境变量
        changeOrigin: true,
        pathRewrite: {
          '^/api': ''
        },
        logLevel: 'debug' // 添加调试日志
      }
    },
  },

  configureWebpack: {
    plugins: [
      new webpack.DefinePlugin({
        '__VUE_PROD_HYDRATION_MISMATCH_DETAILS__': JSON.stringify(false)
      })
    ]
  }
});